﻿namespace Jumpton.SFA.Server.Entity
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Jumpton.Persistent;
    using System.Data;
    using System.Runtime.Serialization;


    [System.SerializableAttribute()]
    [RelationMap("OrderHeader", typeof(ORDER_HEADERS), "a")]
    [Relation(RelationJoinType.Inner, typeof(CUSTOMERS), "b", "a", "ID", "CUSTOMER_ID")]
    public class ORDERHEADERVIEW : ObjectRow
    {

        public ORDERHEADERVIEW()
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">DataTable 中的一行数据</param>
        /// <param name="objectTable">存储当前对象的数据表格</param>
        public ORDERHEADERVIEW(System.Data.DataRow dataRow, ObjectTable parent) :
            base(dataRow, parent)
        {
        }

        /// <summary>
        /// 供反序列化使用的构造函数
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected ORDERHEADERVIEW(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
            base(info, context)
        {
        }

        [Key("ID", TableAlias = "a")]
        public String ID
        {
            get
            {
                return (System.String)GetValue("ID");
            }
            set
            {
                SetValue("ID", value);
            }
        }

        [Key("ORDER_NO", TableAlias = "a")]
        public String ORDER_NO
        {
            get
            {
                return (System.String)GetValue("ORDER_NO");
            }
            set
            {
                SetValue("ORDER_NO", value);
            }
        }

        [Field("ORDER_date", TableAlias = "a")]
        public decimal ORDER_date
        {
            get
            {
                return (System.Decimal)GetValue("ORDER_date");
            }
            set
            {
                SetValue("ORDER_date", value);
            }
        }

        [Field("REQ_DELIVERY_date", TableAlias = "a")]
        public decimal REQ_DELIVERY_date
        {
            get
            {
                return (System.Decimal)GetValue("REQ_DELIVERY_date");
            }
            set
            {
                SetValue("REQ_DELIVERY_date", value);
            }
        }

        [Field("CUSTOMER_ID", TableAlias = "a")]
        public decimal CUSTOMER_ID
        {
            get
            {
                return (System.Decimal)GetValue("CUSTOMER_ID");
            }
            set
            {
                SetValue("CUSTOMER_ID", value);
            }
        }

        [Field("NAME", TableAlias = "b")]
        public string CUSTOMER_NAME
        {
            get
            {
                return (System.String)GetValue("CUSTOMER_NAME");
            }
            set
            {
                SetValue("CUSTOMER_NAME", value);
            }
        }

        [Field("CODE", TableAlias = "b")]
        public string CUSTOMER_CODE
        {
            get
            {
                return (System.String)GetValue("CUSTOMER_CODE");
            }
            set
            {
                SetValue("CUSTOMER_CODE", value);
            }
        }

        [Field("IDENTITY1", TableAlias = "b")]
        public decimal IDENTITY1
        {
            get
            {
                return GetValue("IDENTITY1") == null ? 0 : (System.Decimal)GetValue("IDENTITY1");
            }
            set
            {
                SetValue("IDENTITY1", value);
            }
        }

        [Field("IDENTITY2", TableAlias = "b")]
        public decimal IDENTITY2
        {
            get
            {
                return GetValue("IDENTITY2") == null ? 0 : (System.Decimal)GetValue("IDENTITY2");
            }
            set
            {
                SetValue("IDENTITY2", value);
            }
        }

        [Field("TOTAL_AMOUNT", TableAlias = "a")]
        public decimal TOTAL_AMOUNT
        {
            get
            {
                return (System.Decimal)GetValue("TOTAL_AMOUNT");
            }
            set
            {
                SetValue("TOTAL_AMOUNT", value);
            }
        }

        [Field("TOTAL_QUANTITY", TableAlias = "a")]
        public decimal TOTAL_QUANTITY
        {
            get
            {
                return (System.Decimal)GetValue("TOTAL_QUANTITY");
            }
            set
            {
                SetValue("TOTAL_QUANTITY", value);
            }
        }

        [Field("STATUS", TableAlias = "a")]
        public decimal STATUS
        {
            get
            {
                return (System.Decimal)GetValue("STATUS");
            }
            set
            {
                SetValue("STATUS", value);
            }
        }

        [Field("VISIT_ID", TableAlias = "a")]
        public Decimal VISIT_ID
        {
            get
            {
                return (System.Decimal)GetValue("VISIT_ID");
            }
            set
            {
                SetValue("VISIT_ID", value);
            }
        }

        [Field("DOMAIN_ID", TableAlias = "a")]
        public Decimal DOMAIN_ID
        {
            get
            {
                return (System.Decimal)GetValue("DOMAIN_ID");
            }
            set
            {
                SetValue("DOMAIN_ID", value);
            }
        }

        [Field("REC_USER_CODE", TableAlias = "a")]
        public string REC_USER_CODE
        {
            get
            {
                return (System.String)GetValue("REC_USER_CODE");
            }
            set
            {
                SetValue("REC_USER_CODE", value);
            }
        }

        [Field("REC_TIME_STAMP", TableAlias = "a")]
        public decimal REC_TIME_STAMP
        {
            get
            {
                return (System.Decimal)GetValue("REC_TIME_STAMP");
            }
            set
            {
                SetValue("STATUS", value);
            }
        }

        [Field("USER_ID", TableAlias = "a")]
        public decimal USER_ID
        {
            get
            {
                return (System.Decimal)GetValue("USER_ID");
            }
            set
            {
                SetValue("USER_ID", value);
            }
        }

        [Field("REQUESTED_DELIVERY_TIME", TableAlias = "a")]
        public decimal REQUESTED_DELIVERY_TIME
        {
            get
            {
                return (System.Decimal)GetValue("REQUESTED_DELIVERY_TIME");
            }
            set
            {
                SetValue("REQUESTED_DELIVERY_TIME", value);
            }
        }

        [Field("PROMO", TableAlias = "a")]
        public string PROMO
        {
            get
            {
                return (System.String)GetValue("PROMO");
            }
            set
            {
                SetValue("PROMO", value);
            }
        }

        [Field("ORG_ID", TableAlias = "a")]
        public int ORG_ID
        {
            get
            {
                return (System.Int32)GetValue("ORG_ID");
            }
            set
            {
                SetValue("ORG_ID", value);
            }
        }

        [Field("PERSON_ID", TableAlias = "a")]
        public decimal PERSON_ID
        {
            get
            {
                return (System.Decimal)GetValue("PERSON_ID");
            }
            set
            {
                SetValue("PERSON_ID", value);
            }
        }

        [Field("SUPPLY_ID", TableAlias = "a")]
        public decimal SUPPLY_ID
        {
            get
            {
                return (System.Decimal)GetValue("SUPPLY_ID");
            }
            set
            {
                SetValue("SUPPLY_ID", value);
            }
        }

        [Field("OrderType", TableAlias = "a")]
        public int OrderType
        {
            get
            {
                return (System.Int32)GetValue("OrderType");
            }
            set
            {
                SetValue("OrderType", value);
            }
        }

        [Field("CHAIN_ID", TableAlias = "a")]
        public int CHAIN_ID
        {
            get
            {
                return (System.Int32)GetValue("CHAIN_ID");
            }
            set
            {
                SetValue("CHAIN_ID", value);
            }
        }

        [Field("CONFIRMED_DATE", TableAlias = "a")]
        public decimal CONFIRMED_DATE
        {
            get
            {
                return (System.Decimal)GetValue("CONFIRMED_DATE");
            }
            set
            {
                SetValue("CONFIRMED_DATE", value);
            }
        }

        [Field("ARRIVAL_DATE", TableAlias = "a")]
        public decimal ARRIVAL_DATE
        {
            get
            {
                return (System.Decimal)GetValue("ARRIVAL_DATE");
            }
            set
            {
                SetValue("ARRIVAL_DATE", value);
            }
        }

        [Field("ORDER_FORM", TableAlias = "a")]
        public decimal ORDER_FORM
        {
            get
            {
                return (System.Decimal)GetValue("ORDER_FORM");
            }
            set
            {
                SetValue("ORDER_FORM", value);
            }
        }
    }
}
